<?php $url = new Url();?>
<link type="text/css" href="<?=Yii::app()->params["urlRs"] ?>/js/jqueryui/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Yii::app()->params["urlRs"] ?>/js/jqueryui/jquery-ui-1.8.23.custom.min.js"></script>

<div class="nosidebar" id="main">    
    <div id="content">
        <h2>Thời gian</h2>

        <form method="post" id="new_time_entry" class="new_time_entry" action="/time_entries" accept-charset="UTF-8">
            <div class="box tabular">        
                <p>
                    <label for="time_entry_issue_id">Công việc</label>
                    <input type="text" value="<?php echo $task_data['task_id']; ?>" size="6" name="task_id" id="task_id" disabled="disabled"> 
                    <em>Công việc #<?php echo $task_data['task_id']; ?>: <?php echo $task_data['task_name']; ?></em>
                </p>
                <p>
                    <label for="time_entry_spent_on">Ngày<span class="required"> *</span></label>
                    <input id="log_date" name="log_date" size="10" value="<?php echo date("d/m/Y",time()); ?>" type="text">
                </p>
                <p>
                    <label for="time_entry_hours">Giờ<span class="required"> *</span></label>
                    <input type="text" size="6" name="log_hours" id="log_hours">
                </p>
                <p>
                    <label for="time_entry_hours">Tiến độ công việc<span class="required"> *</span></label>
                    <select id="task_percent_done" name="task_percent_done">
                        <option value="0" <?php if($task_data['task_percent_done'] == 0){ echo "selected";} ?>>0 %</option>
                        <option value="10" <?php if($task_data['task_percent_done'] == 10){ echo "selected";} ?>>10 %</option>
                        <option value="20" <?php if($task_data['task_percent_done'] == 20){ echo "selected";} ?>>20 %</option>
                        <option value="30" <?php if($task_data['task_percent_done'] == 30){ echo "selected";} ?>>30 %</option>
                        <option value="40" <?php if($task_data['task_percent_done'] == 40){ echo "selected";} ?>>40 %</option>
                        <option value="50" <?php if($task_data['task_percent_done'] == 50){ echo "selected";} ?>>50 %</option>
                        <option value="60" <?php if($task_data['task_percent_done'] == 60){ echo "selected";} ?>>60 %</option>
                        <option value="70" <?php if($task_data['task_percent_done'] == 70){ echo "selected";} ?>>70 %</option>
                        <option value="80" <?php if($task_data['task_percent_done'] == 80){ echo "selected";} ?>>80 %</option>
                        <option value="90" <?php if($task_data['task_percent_done'] == 90){ echo "selected";} ?>>90 %</option>
                        <option value="100" <?php if($task_data['task_percent_done'] == 100){ echo "selected";} ?>>100 %</option>
                    </select>
                </p>
                <p>
                    <label for="time_entry_comments">Bình luận</label>
                    <textarea accesskey="e" class="wiki-edit" cols="60" id="log_description" name="log_description" rows="5"></textarea>
                </p>                
            </div>    

            <input type="button" value="Tạo" name="commit" onclick="log_time(<?php echo $task_data['task_id']; ?>)">
        </form>

        <div style="clear:both;"></div>
    </div>
</div>

<?php include "log_time.js.php"; ?>
